package com.ay.weixin.autoreply.db;

import java.sql.SQLException;
import java.util.LinkedHashMap;
import java.util.Map;

import lizar.db.ibatis.Dao;

import com.ay.weixin.autoreply.domain.ClickEvent;

public class IbatisClickEventDao extends Dao{

	public ClickEvent getClickEvent(long wxproject_id,String key) throws SQLException{
		Map<String,Object> keys=new LinkedHashMap<String,Object>();
		keys.put("key", key);
		keys.put("wxproject_id", wxproject_id);
		return (ClickEvent)this.sqlMapper.queryForObject("click_event.getClickEvent",keys);
	}
	
	public void insert(ClickEvent click_event) throws SQLException{
		this.sqlMapper.insert("click_event.insert",click_event);
	}
	
	public void delete(long wxproject_id,String key) throws SQLException{
		Map<String,Object> keys=new LinkedHashMap<String,Object>();
		keys.put("key", key);
		keys.put("wxproject_id", wxproject_id);
		this.sqlMapper.delete("click_event.delete", keys);
	}
	
}
